package com.ruoyi.system.mapper;

import java.util.List;

import com.ruoyi.system.domain.UmsCustomer;
import com.ruoyi.system.domain.vo.UmsCustomerListVo;
import org.apache.ibatis.annotations.Param;

/**
 * 客户Mapper接口
 *
 * @author ruoyi
 * @date 2023-02-26
 */
public interface UmsCustomerMapper {
    /**
     * 查询客户
     *
     * @param userId 客户主键
     * @return 客户
     */
    public UmsCustomer selectUmsCustomerByUserId(Integer userId);

    /**
     * 同过客户姓名或者用户代码获取客户详情
     * @param account
     * @return
     */
    public UmsCustomer selectUmsCustomerByNameOrCode(String account);

    /**
     * 用过客户名称获取客户详情
     * @param name
     * @return
     */
    UmsCustomer selectUserCustomerByName(String name);

    /**
     * 查询客户列表
     *
     * @param umsCustomer 客户
     * @return 客户集合
     */
    public List<UmsCustomerListVo> selectUmsCustomerList(UmsCustomer umsCustomer);

    /**
     * 新增客户
     *
     * @param umsCustomer 客户
     * @return 结果
     */
    public int insertUmsCustomer(UmsCustomer umsCustomer);

    /**
     * 修改客户
     *
     * @param umsCustomer 客户
     * @return 结果
     */
    public int updateUmsCustomer(UmsCustomer umsCustomer);

    /**
     * 删除客户
     *
     * @param userId 客户主键
     * @return 结果
     */
    public int deleteUmsCustomerByUserId(Long userId);

    /**
     * 批量删除客户
     *
     * @param userIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteUmsCustomerByUserIds(Long[] userIds);

    /**
     * 根据客户姓名获取用户账号详情
     * @param name
     * @return
     */
    UmsCustomer getCustomerByName(String name);

    int getCustomerByCode(String code);


}
